#include<pthread.h>
#include<stdio.h>
namespace CONC_DBL_LOCK {


	void foo(pthread_mutex_t mutex)
	{
		pthread_mutex_lock(&mutex);
		pthread_mutex_lock(&mutex);
		return;
	}

	int main()
	{
		pthread_mutex_t mutex;
		if (pthread_mutex_init(&mutex, NULL) != 0) {
			printf("\n mutex init has failed\n");
			return 1;
		}

		foo(mutex);
		return 0;
	}

	void foo(pthread_mutex_t mutex)
	{
		pthread_mutex_lock(&mutex);
		pthread_mutex_unlock(&mutex);
		return;
	}

	int main()
	{
		pthread_mutex_t mutex;
		if (pthread_mutex_init(&mutex, NULL) != 0) {
			printf("\n mutex init has failed\n");
			return 1;
		}

		foo(mutex);
		return 0;
	}
}